home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / dev / misc / LEDA_high.lha / LEDA-3.1c-high / prog / prio / prio.c < prev   
Encoding:
C/C++ Source or Header  |  1994-08-05  |  436 b   |  30 lines

  1. #include <LEDA/prio.h>
  2.  
  3.  
  4. //void show(priority_queue<double,string> Q)
  5.  
  6. void show(priority_queue<double,string>& Q)
  7. { pq_item it;
  8.   while (!Q.empty())
  9.   { it = Q.find_min();
  10.     cout << "delete: " << Q.key(it) << " " << Q.inf(it) << "\n";
  11.     Q.del_item(it);
  12.    }
  13. }
  14.  
  15. main()
  16.  
  17. { priority_queue<double,string> Q;
  18.   double r;
  19.  
  20.   while (cin >> r) Q.insert(r,string("inf = %f",r));
  21.  
  22.   show(Q);
  23.   newline;
  24.  
  25.   show(Q);
  26.   newline;
  27.  
  28.   return 0;
  29. }
  30.